/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package wiView.graphics.Drawer;

import java.util.ArrayList;
import wiBase.WiObject;
import wiBase.baseInterface.OnDrawerListener;
import wiBase.baseObject.Node;
import wiView.graphics.Drawer.NetworkEventDispatcher.*;
import wiView.graphics.Drawer.GraphAnimation.*;
import wiBase.baseObject.Event;
/**
 * 
 *
 * @author Hoang
 */
public abstract class AbstractDrawer implements OnDrawerListener{
    IEventDispatcher eventDispatcher;
    AbstractAnimationHandle animationHandle;
    
    @Override
    public void updateState(WiObject object) {
        if(object == null || !(object instanceof Event))
            return;
        if(eventDispatcher != null && animationHandle != null){
            Event e = (Event)object;
            animationHandle.addAnimator(eventDispatcher.CreateAnimator(e));
        }
            
    }

    @Override
    public abstract void DrawNodes(ArrayList<Node> nodes);

    @Override
    public abstract void Start();
    public void Stop(){
        animationHandle.Stop();
    }
}
